// component/alert_msg/alert_msg.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
     
  },

  /**
   * 组件的初始数据
   */
  data: {
		// const currentDate = this.getDate({
		// 	format: true
		// })
	 
		date: '2016-09', //日期
		patients:[
		  { name: '苗丽丽' },
		  { name: '苗丽丽' },
		  { name: '苗丽丽' },
		  { name: '苗丽丽' },
		  { name:'苗丽丽'  },
		]
 
  },

  /**
   * 组件的方法列表
   */
  methods: {
		bindDateChange(e) {
			console.log(e)
			// this.date = e.target.value
			this.setData({
			  date: e.detail.value
			})
		},
		getDate(type) {
			const date = new Date();
			let year = date.getFullYear();
			let month = date.getMonth() + 1;
			// let day = date.getDate();
			if (type === 'start') {
				year = year - 60;
			} else if (type === 'end') {
				year = year + 2;
			}
			month = month > 9 ? month : '0' + month;
			// day = day > 9 ? day : '0' + day;
			// return `${year}-${month}-${day}`;
			return `${year}-${month}`;
		},
  }
})
